package com.rongke.model;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.rongke.utils.DateJsonDeserializer;
import com.rongke.utils.DateJsonSerializer;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.List;

/**
 * @Sku
 * @商品sku(sku)
 * @version : Ver 1.0
 */
@TableName("sku")
public class Sku implements Serializable {
	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	/**
	 * @备注:商品sku
	 * @字段:sku_id BIGINT(19)
	 */
	@TableId(type = IdType.AUTO)
	private Long id;


	/**
	 * @备注:商品id
	 * @字段:goods_id BIGINT(19)
	 */
	private Long goodsId;

    @TableField(exist = false)
	private List<PropValue> propValues;

	@TableField(exist = false)
	private Goods goods;

	/**
	 * @备注:属性字符串
	 * @字段:prop_str VARCHAR(100)
	 */
	private String propStr;

	/**
	 * @备注:属性值拼接名（订单显示等地方用，如“红色、20g”）
	 * @字段:values_str VARCHAR(100)
	 */
	private java.lang.String valuesStr;

	/**
	 * @备注:sku图片
	 * @字段:sku_url TEXT(65535)
	 */
	private java.lang.String skuUrl;

	/**
	 * @备注:该sku对应价格
	 * @字段:price DECIMAL(10)
	 */
	private java.math.BigDecimal price;


	/**
	 * @备注:该sku对应库存
	 * @字段:inventory INT(10)
	 */
	private Integer inventory;

	@TableField(exist = false)
	private Integer nums;//每种sku对应的购买数量（购物车使用）

	/**
	 * @备注:是否统一规格（0 统一规格 1 多规格）
	 * @字段:if_uniform_spec TINYINT(3)
	 */
	private Integer ifUniformSpec;


	/**
	 * @备注:状态(下架或在售)
	 * @字段:state INT(10)
	 */
	private Integer state;


	/**
	 * @备注:创建日期
	 * @字段:gmt_datetime DATETIME(19)
	 */
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date gmtDatetime;


	/**
	 * @备注:更新日期
	 * @字段:upt_datetime DATETIME(19)
	 */
	@JsonSerialize(using=DateJsonSerializer.class)
	@JsonDeserialize(using=DateJsonDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss" )
	private java.util.Date uptDatetime ;




	public Sku(){
	}

	public Sku(
		Long id
	){
		this.id = id;
	}


	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setGoodsId(Long goodsId) {
		this.goodsId = goodsId;
	}

	public Long getGoodsId() {
		return this.goodsId;
	}

	public List<PropValue> getPropValues() {
		return propValues;
	}

	public void setPropValues(List<PropValue> propValues) {
		this.propValues = propValues;
	}

	public void setPropStr(String propStr) {
		this.propStr = propStr;
	}

	public String getPropStr() {
		return this.propStr;
	}

	public String getValuesStr() {
		return valuesStr;
	}

	public void setValuesStr(String valuesStr) {
		this.valuesStr = valuesStr;
	}

	public void setSkuUrl(java.lang.String skuUrl) {
		this.skuUrl = skuUrl;
	}

	public java.lang.String getSkuUrl() {
		return this.skuUrl;
	}

	public Integer getNums() {
		return nums;
	}

	public void setNums(Integer nums) {
		this.nums = nums;
	}

	public void setPrice(java.math.BigDecimal price) {
		this.price = price;
	}

	public java.math.BigDecimal getPrice() {
		return this.price;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public void setInventory(Integer inventory) {
		this.inventory = inventory;
	}

	public Integer getInventory() {
		return this.inventory;
	}


	public void setIfUniformSpec(Integer ifUniformSpec) {
		this.ifUniformSpec = ifUniformSpec;
	}

	public Integer getIfUniformSpec() {
		return this.ifUniformSpec;
	}


	public void setState(Integer state) {
		this.state = state;
	}

	public Integer getState() {
		return this.state;
	}


	public void setGmtDatetime(java.util.Date gmtDatetime) {
		this.gmtDatetime = gmtDatetime;
	}

	public java.util.Date getGmtDatetime() {
		return this.gmtDatetime;
	}


	public void setUptDatetime(java.util.Date uptDatetime) {
		this.uptDatetime = uptDatetime;
	}

	public java.util.Date getUptDatetime() {
		return this.uptDatetime;
	}
}
